//
// Created by void on 24-1-14.
//
#ifndef RECTORHTTPSERVER_TCPSERVER_H
#define RECTORHTTPSERVER_TCPSERVER_H
#include <EventLoop.h>
#include <ThreadPool.h>
#include <TcpConnection.h>

#include <arpa/inet.h>
#include <stdlib.h>
#include <stdio.h>

struct Listener {
    int lfd;
    unsigned short port;
};

struct TcpServer {
    int threadNum;
    struct EventLoop* mainLoop;
    struct ThreadPool* threadPool;
    struct Listener* listener;
};

struct TcpServer* tcpServerInit(unsigned short port, int threadNum);

struct Listener* listenerInit(unsigned short port);

void tcpServerRun(struct TcpServer* server);



#endif //RECTORHTTPSERVER_TCPSERVER_H
